﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BacteriaSimulation.Simulation
{
    public class SimulationEnvironment
    {
        protected SimulationEnvironment instance;

        public static readonly Double MAX_ENERGY = 30;
        public static readonly Double INITIAL_ENERGY = 10;
        public static readonly Double MAX_SPEED_COMPONENT = 6;
        //public static readonly Double INITIAL_WIDTH = 5;
        //public static readonly Double INITIAL_HEIGHT = 5;
        public static readonly Double EPSILON = 0.01;
        public static readonly Int32 MAX_BACTERIA_COUNT = 512;
        public static readonly Int32 SIMULATION_STEP_INTERVAL = 40;
        public static readonly Double ENERGY_INCREMENT = .2;
        //public static readonly Double WIDTH_INCREMENT = 1;
        //public static readonly Double HEIGHT_INCREMENT = 1;
        public static readonly Boolean DETECT_BACTERIA_COLLISION = true;

        public Double Width { get; set;  }
        public Double Height { get; set; }

        public Double MaxEnergy { get; set; }
        public Double InitialEnergy { get; set; }
        public Double MaxSpeedComponent { get; set; }
        //public Double InitialWidth { get; set; }
        //public Double InitialHeight { get; set; }
        public Double Epsilon { get; set; }
        public Int32 MaxBacteriaCount { get; set; }
        public Int32 SimulationStepInterval { get; set; }
        public Double EnergyIncrement { get; set; }
        //public Double WidthIncrement { get; set; }
        //public Double HeightIncrement { get; set; }
        public Boolean DetectBacteriaCollision { get; set; }
        public Double TotalMass { get; set; }

        public SimulationEnvironment(Double width, Double height)
        {
            this.Width = width;
            this.Height = height;

            MaxEnergy = MAX_ENERGY;
            InitialEnergy = INITIAL_ENERGY;
            MaxSpeedComponent = MAX_SPEED_COMPONENT;
            //InitialWidth = INITIAL_WIDTH;
            //InitialHeight = INITIAL_HEIGHT;
            Epsilon = EPSILON;
            MaxBacteriaCount = MAX_BACTERIA_COUNT;
            SimulationStepInterval = SIMULATION_STEP_INTERVAL;
            EnergyIncrement = ENERGY_INCREMENT;
            //WidthIncrement = WIDTH_INCREMENT;
            //HeightIncrement = HEIGHT_INCREMENT;
            this.DetectBacteriaCollision = DETECT_BACTERIA_COLLISION;
        }
    }
}
